export default {
  data() {
    return {
      // 默认的全局分享内容
      share: {
        title: "在线购票",
        path: "/pages/login/index", // 全局分享的路径，比如 首页
        imageUrl: "/static/img/bannar.png", // 全局分享的图片(可本地可网络)
      },
    };
  },
  onLoad(option) {
    console.log("sssssss", option);
  },
  // 定义全局分享
  // 1.发送给朋友
  onShareAppMessage(res) {
    const { id } = uni.getStorageSync("userInfo") || {};
    const orgId = uni.getStorageSync('orgId')
    return {
      title: this.share.title,
      path: `${this.share.path}?inviter=${id || ""}&orgId=${orgId}`,
      imageUrl: this.share.imageUrl,
    };
  },
  //2.分享到朋友圈
  onShareTimeline(res) {
    const { id } = uni.getStorageSync("userInfo") || {};
    const orgId = uni.getStorageSync('orgId')
    return {
      title: this.share.title,
      path: `${this.share.path}?inviter=${id || ""}&orgId=${orgId}`,
      imageUrl: this.share.imageUrl,
    };
  },
};
